package com.sqlsession.database;

/**
 * 表里面的字段
 */
public class CColumn {

    private CTable cTable;

    /**
     * 字段名称
     */
    private String name;
    /**
     * 字段类型
     */
    private String type;
    /**
     * 字段注释
     */
    private String common;

    /**
     * 是否为主键
     */
    private boolean isKey;

    /**
     * 数据长度
     */
    private Integer length;

    /**
     * 是否可空
     */
    private boolean allowBlank;

    public boolean isAllowBlank() {
        return allowBlank;
    }

    public void setAllowBlank(boolean allowBlank) {
        this.allowBlank = allowBlank;
    }

    public CColumn(CTable cTable) {
        this.cTable = cTable;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCommon() {
        return common;
    }

    public void setCommon(String common) {
        this.common = common;
    }

    public boolean isPrimaryKey() {
        return isKey;
    }

    public void primaryKey(boolean key) {
        isKey = key;
    }

    public final CTable getcTable() {
        return cTable;
    }
}
